|
diffpress5 2.2.1
|
API for configuring and manipulating Diff Press 5 Click driver. More...
Topics | |
| Diff Press 5 Settings | |
| Settings of Diff Press 5 Click driver. | |
| Diff Press 5 MikroBUS Map | |
| MikroBUS pin mapping of Diff Press 5 Click driver. | |
Functions | |
| void | diffpress5_cfg_setup (diffpress5_cfg_t *cfg) |
| Diff Press 5 configuration object setup function. | |
| void | diffpress5_drv_interface_sel (diffpress5_cfg_t *cfg, diffpress5_drv_t drv_sel) |
| Diff Press 5 driver interface setup function. | |
| err_t | diffpress5_init (diffpress5_t *ctx, diffpress5_cfg_t *cfg) |
| Diff Press 5 initialization function. | |
| err_t | diffpress5_read_adc_raw (diffpress5_t *ctx, uint16_t *raw_adc) |
| Diff Press 5 read raw ADC value function. | |
| err_t | diffpress5_read_adc_voltage (diffpress5_t *ctx, float *voltage) |
| Diff Press 5 read voltage level function. | |
| err_t | diffpress5_set_vref (diffpress5_t *ctx, float vref) |
| Diff Press 5 set vref function. | |
| err_t | diffpress5_read_vout (diffpress5_t *ctx, float *vout) |
| Diff Press 5 read vout function. | |
| err_t | diffpress5_read_vout_avg (diffpress5_t *ctx, uint16_t num_conv, float *vout_avg) |
| Diff Press 5 read vout avg function. | |
| err_t | diffpress5_calib_offset (diffpress5_t *ctx) |
| Diff Press 5 calib offset function. | |
| err_t | diffpress5_read_pressure (diffpress5_t *ctx, uint16_t *pressure) |
| Diff Press 5 read pressure function. | |
API for configuring and manipulating Diff Press 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| err_t diffpress5_calib_offset | ( | diffpress5_t * | ctx | ) |
Diff Press 5 calib offset function.
This function calibrates the zero current offset value.
| [in] | ctx | : Click context object. See diffpress5_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void diffpress5_cfg_setup | ( | diffpress5_cfg_t * | cfg | ) |
Diff Press 5 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See diffpress5_cfg_t object definition for detailed explanation. |
| void diffpress5_drv_interface_sel | ( | diffpress5_cfg_t * | cfg, |
| diffpress5_drv_t | drv_sel ) |
Diff Press 5 driver interface setup function.
This function sets a serial driver interface which will be used further in the Click driver.
| [out] | cfg | : Click configuration structure. See diffpress5_cfg_t object definition for detailed explanation. |
| [in] | drv_sel | : Driver interface selection. See diffpress5_drv_t object definition for detailed explanation. |
| err_t diffpress5_init | ( | diffpress5_t * | ctx, |
| diffpress5_cfg_t * | cfg ) |
Diff Press 5 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See diffpress5_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See diffpress5_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t diffpress5_read_adc_raw | ( | diffpress5_t * | ctx, |
| uint16_t * | raw_adc ) |
Diff Press 5 read raw ADC value function.
This function reads raw ADC value.
| [in] | ctx | : Click context object. See diffpress5_t object definition for detailed explanation. |
| [out] | raw_adc | : Output ADC result. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t diffpress5_read_adc_voltage | ( | diffpress5_t * | ctx, |
| float * | voltage ) |
Diff Press 5 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
| [in] | ctx | : Click context object. See diffpress5_t object definition for detailed explanation. |
| [out] | voltage | : Output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t diffpress5_read_pressure | ( | diffpress5_t * | ctx, |
| uint16_t * | pressure ) |
Diff Press 5 read pressure function.
This function reads the differential pressure measurement.
| [in] | ctx | : Click context object. See diffpress5_t object definition for detailed explanation. |
| [out] | pressure | : Differential pressure level [Pa]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t diffpress5_read_vout | ( | diffpress5_t * | ctx, |
| float * | vout ) |
Diff Press 5 read vout function.
This function reads the sensor output voltage.
| [in] | ctx | : Click context object. See diffpress5_t object definition for detailed explanation. |
| [out] | vout | : Output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t diffpress5_read_vout_avg | ( | diffpress5_t * | ctx, |
| uint16_t | num_conv, | ||
| float * | vout_avg ) |
Diff Press 5 read vout avg function.
This function reads a desired number of sensor voltage output samples and averages it.
| [in] | ctx | : Click context object. See diffpress5_t object definition for detailed explanation. |
| [in] | num_conv | : Number of ADC samples. |
| [out] | vout_avg | : Average output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t diffpress5_set_vref | ( | diffpress5_t * | ctx, |
| float | vref ) |
Diff Press 5 set vref function.
This function sets the voltage reference for Diff Press 5 Click driver.
| [in] | ctx | : Click context object. See diffpress5_t object definition for detailed explanation. |
| [in] | vref | : Reference voltage (volts). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.